<?php defined( '_VALID_MOS' ) or die( include_once("../../404.php") );

    // áo thun
    $categoryID1='77';
    
    $sql1 ="SELECT I_ID,I_Code,I_Alias,I_Title,I_Description,I_Detail,I_Image,I_CategoryID, C_Title, I_Price,Date_FORMAT(I_CreatedDate, '%d/%m/%Y') As CreatedDate, Date_FORMAT(I_ModifiedDate, '%d/%m/%Y') As ModifiedDate,creUser.FullName,moUser.FullName, I_State
        	   FROM items JOIN categories on I_CategoryID = C_ID JOIN account as creUser on I_CreatedUser = creUser.Ac_Id JOIN account as moUser on I_ModifiedUser = moUser.Ac_Id WHERE I_State = 1 AND I_CategoryID IN (       
                
        		SELECT  DISTINCT level1.C_ID        
        		FROM categories AS level1         
        		LEFT OUTER JOIN categories AS level2        
        		ON level2.C_Parent = level1.C_ID         
        		LEFT OUTER JOIN categories AS level3        
        		ON level3.C_Parent = level2.C_ID        
        		LEFT OUTER JOIN categories AS level4        
        		ON level4.C_Parent = level3.C_ID        
        		LEFT OUTER JOIN categories AS level5        
        		ON level5.C_Parent = level4.C_ID        
        		WHERE level1.C_ID = $categoryID1 AND level1.C_ID <>-1    
                    
        		UNION
        
        		SELECT  DISTINCT level2.C_ID        
        		FROM categories AS level1         
        		LEFT OUTER JOIN categories AS level2        
        		ON level2.C_Parent = level1.C_ID         
        		LEFT OUTER JOIN categories AS level3        
        		ON level3.C_Parent = level2.C_ID        
        		LEFT OUTER JOIN categories AS level4        
        		ON level4.C_Parent = level3.C_ID        
        		LEFT OUTER JOIN categories AS level5        
        		ON level5.C_Parent = level4.C_ID        
        		WHERE level1.C_ID = $categoryID1 AND level2.C_ID <>-1
        
        		UNION 
        
        		SELECT DISTINCT level3.C_ID        
        		FROM categories AS level1         
        		LEFT OUTER JOIN categories AS level2        
        		ON level2.C_Parent = level1.C_ID         
        		LEFT OUTER JOIN categories AS level3        
        		ON level3.C_Parent = level2.C_ID        
        		LEFT OUTER JOIN categories AS level4        
        		ON level4.C_Parent = level3.C_ID        
        		LEFT OUTER JOIN categories AS level5        
        		ON level5.C_Parent = level4.C_ID        
        		WHERE level1.C_ID = $categoryID1 AND level3.C_ID <>-1
        
        		UNION 
        
        		SELECT DISTINCT level4.C_ID        
        		FROM categories AS level1         
        		LEFT OUTER JOIN categories AS level2        
        		ON level2.C_Parent = level1.C_ID         
        		LEFT OUTER JOIN categories AS level3        
        		ON level3.C_Parent = level2.C_ID     
        		LEFT OUTER JOIN categories AS level4        
        		ON level4.C_Parent = level3.C_ID        
        		LEFT OUTER JOIN categories AS level5        
        		ON level5.C_Parent = level4.C_ID        
        		WHERE level1.C_ID = $categoryID1 AND level4.C_ID <>-1
        
        		UNION 
        
        		SELECT DISTINCT level5.C_ID	        
        		FROM categories AS level1         
        		LEFT OUTER JOIN categories AS level2        
        		ON level2.C_Parent = level1.C_ID         
        		LEFT OUTER JOIN categories AS level3        
        		ON level3.C_Parent = level2.C_ID        
        		LEFT OUTER JOIN categories AS level4        
        		ON level4.C_Parent = level3.C_ID        
        		LEFT OUTER JOIN categories AS level5        
        		ON level5.C_Parent = level4.C_ID        
        		WHERE level1.C_ID = $categoryID1 AND level5.C_ID <>-1    
        	)             
        	ORDER BY I_Order DESC Limit 10";                        
                 
    $cmd1 = $mysqli->prepare($sql1);
    $cmd1->execute() or die($mysqli->error);
    $cmd1->bind_result($ID1, $code1, $alias1, $title1, $description1, $detail1, $image1, $categoryID1, $categoryTitle1, $price1, $createdDate1, $modifiedDate1, $createdUser1, $modifiedUser1, $state1);
    $cmd1->store_result();   
?>

    <style type="text/css">
        .slideshow1 {float: left; height: 190px; width: 190px; margin: auto }
        .slideshow2 {float: left; height: 190px; width: 190px; margin: auto }
        .slideshow3 {float: left; height: 190px; width: 190px; margin: auto }
    </style>  
    
    <script type="text/javascript">
    $(document).ready(function() {
    
        $('.slideshow1').cycle({
    		fx: 'scrollDown', 
            delay: 6     
    	});    
        
        $('.slideshow2').cycle({
    		fx: 'curtainY',   
            delay: 4    
    	});   
        
        $('.slideshow3').cycle({
    		fx: 'scrollDown',
            delay: 8      
    	});                
    });
    </script>     
    
    
<!-- áo thun -->
<div id="rightBox">

    <!-- sub component -->
    <div id="sub_box">
    
        <!-- title bar -->
    	<div class="right_title_bar_background">
            <div class="left_title_bar_background">
                <div class="center_title_bar_background">
                    <div class="title_bar">
                    ÁO THUN
                    </div>
                </div>
            </div>
        </div>
        
                		                                                      		
	<div class="slideshow1">
        <?php while($cmd1->fetch()){ ?>
			 <img style="position: absolute; top: 0px; left: 0px; display: none; z-index: 5; opacity: 0; width: 190px; height: 190px;" src="<?php echo $image1; ?>"/>
	   <?php } ?>                            	
	</div>
                                	                        
	</div>
	
</div>

<div class="clear"></div>

<?php

    $cmd1->close();
    
    $categoryID2 ='44';
    
    $sql2 ="SELECT I_ID,I_Code,I_Alias,I_Title,I_Description,I_Detail,I_Image,I_CategoryID, C_Title, I_Price,Date_FORMAT(I_CreatedDate, '%d/%m/%Y') As CreatedDate, Date_FORMAT(I_ModifiedDate, '%d/%m/%Y') As ModifiedDate,creUser.FullName,moUser.FullName, I_State
        	   FROM items JOIN categories on I_CategoryID = C_ID 
               JOIN account as creUser on I_CreatedUser = creUser.Ac_Id 
               JOIN account as moUser on I_ModifiedUser = moUser.Ac_Id 
               WHERE I_State = 1 AND I_CategoryID = $categoryID2 ORDER BY I_Order DESC Limit 10";  

    
               
    $cmd2 = $mysqli->prepare($sql2);
    $cmd2->execute() or die($mysqli->error);
    $cmd2->bind_result($ID2, $code2, $alias2, $title2, $description2, $detail2, $image2, $categoryID2, $categoryTitle2, $price2, $createdDate2, $modifiedDate2, $createdUser2, $modifiedUser2, $state2);
    $cmd2->store_result();
        
        
  
?>

<!-- áo mưa -->
<div id="rightBox">

    <!-- sub component -->
    <div id="sub_box">
    
        <!-- title bar -->
    	<div class="right_title_bar_background">
            <div class="left_title_bar_background">
                <div class="center_title_bar_background">
                    <div class="title_bar">
                    ÁO MƯA
                    </div>
                </div>
            </div>
        </div>
        
                		                                                      		
	<div class="slideshow2">
        <?php while($cmd2->fetch()){ ?>
			 <img style="position: absolute; top: 0px; left: 0px; display: none; z-index: 5; opacity: 0; width: 190px; height: 190px;" src="<?php echo $image2; ?>"/>
	   <?php } ?>                            	
	</div>

        
	</div>
	
</div>

<div class="clear"></div>


<?php
    $cmd2->close();
    
    $categoryID3 ='53';
    
    $sql3 ="SELECT I_ID,I_Code,I_Alias,I_Title,I_Description,I_Detail,I_Image,I_CategoryID, C_Title, I_Price,Date_FORMAT(I_CreatedDate, '%d/%m/%Y') As CreatedDate, Date_FORMAT(I_ModifiedDate, '%d/%m/%Y') As ModifiedDate,creUser.FullName,moUser.FullName, I_State
        	   FROM items JOIN categories on I_CategoryID = C_ID 
               JOIN account as creUser on I_CreatedUser = creUser.Ac_Id 
               JOIN account as moUser on I_ModifiedUser = moUser.Ac_Id 
               WHERE I_State = 1 AND I_CategoryID = $categoryID3 ORDER BY I_Order DESC Limit 10";  
                       
    $cmd3 = $mysqli->prepare($sql3);
    $cmd3->execute() or die($mysqli->error);
    $cmd3->bind_result($ID3, $code3, $alias3, $title3, $description3, $detail3, $image3, $categoryID3, $categoryTitle3, $price3, $createdDate3, $modifiedDate3, $createdUser3, $modifiedUser3, $state3);
    $cmd3->store_result();  

?>


<!-- quà tặng -->
<div id="rightBox">

    <!-- sub component -->
    <div id="sub_box">
    
        <!-- title bar -->
    	<div class="right_title_bar_background">
            <div class="left_title_bar_background">
                <div class="center_title_bar_background">
                    <div class="title_bar">
                    QUÀ TẶNG
                    </div>
                </div>
            </div>
        </div>
        
                		                                                      		
	<div class="slideshow3">
        <?php while($cmd3->fetch()){ ?>
			 <img style="position: absolute; top: 0px; left: 0px; display: none; z-index: 5; opacity: 0; width: 190px; height: 190px;" src="<?php echo $image3; ?>"/>
	   <?php } ?>                            	
	</div>
    
  <div class="clear"></div>
             <!-- bottom bar background -->
        <div class="bottom_bar_background"></div>
        <!-- end bottom bar background -->   
                                     	               
	</div>
    
	
</div>


